package com.wxgy.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wxgy.entity.User;
import com.wxgy.service.IUserService;
import com.wxgy.service.UserService;
import com.wxgy.service.impl.UserServiceImpl;

@WebServlet("/QueryAllUserServlet")
public class QueryAllUserServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//		UserService us=new UserService();
		IUserService us=new UserServiceImpl();
		List<User> list=us.queryAllUser();
		request.setAttribute("list", list);
		request.getRequestDispatcher("index.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		doGet(request, response);
	}

}
